var express = require('express');
var index = require('../services/index');
var router = express.Router();
var fs = require('fs');
router.get('/', index.index);
router.get('/user', index.user);
router.get('/data', function (req, res, next) {
    fs.readFile("hof-batting.json", "UTF-8", (err, data)=> {
        var jsonData = JSON.parse(data);
        res.setHeader("Content-Range", req.headers.range + "/" + jsonData.length);
        res.json(jsonData);
    });
});
module.exports = router;
